package com.wx.activitys.valsday.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wx.activitys.valsday.mapper.ValsDayAccessMapper;
import com.wx.activitys.valsday.model.ValsDayAccess;
import com.wx.activitys.valsday.service.ValsDayAccessService;
@Service("ValsDayAccessService")
public class ValsDayAccessServiceImpl implements ValsDayAccessService {
	@Autowired
	ValsDayAccessMapper valsDayAccessMapper;
	
	public int insertValsDayAccess(ValsDayAccess valsDayAccess) {
		
		return valsDayAccessMapper.insert(valsDayAccess);
	}

	public int updateValsDayAccessStatus(ValsDayAccess valsDayAccess) {
		valsDayAccess.setStatus(0);
		return valsDayAccessMapper.updateByPrimaryKey(valsDayAccess);
	}

	public ValsDayAccess selectValsDayAccessByPrimaryKey(Integer id) {
		
		return valsDayAccessMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<ValsDayAccess> selectValsDayAccessByOpenid(ValsDayAccess valsDayAccess) {
		ValsDayAccess valsDayAccess1 = new ValsDayAccess();
		valsDayAccess1.setStatus(1);
		valsDayAccess1.setOpenid(valsDayAccess.getOpenid());
		
		return valsDayAccessMapper.selectByVals(valsDayAccess1);
	}


}
